28 #ifndef _spoton_smp_h_ 29 #define _spoton_smp_h_ 45 static const unsigned int BITS = 1536;
46 static gcry_mpi_t generateWeakRandomPrime(
bool *ok);
47 static void test1(
void);
48 static void test2(
void);
49 static void test3(
void);
50 static void test4(
void);
51 QByteArray guessSha(
void)
const;
52 QByteArray guessWhirlpool(
void)
const;
53 QList<QByteArray> coordinatesProof(
const gcry_mpi_t g2,
58 QList<QByteArray> equalLogs(
const gcry_mpi_t qab,
62 QList<QByteArray> logProof(
const gcry_mpi_t g,
66 QList<QByteArray> nextStep(
const QList<QByteArray> &other,
67 bool *ok,
bool *passed);
68 QList<QByteArray> step1(
bool *ok);
70 QString guessString(
void)
const 75 bool passed(
void)
const;
76 bool verifyCoordinatesProof(
const QList<QByteArray> &list,
81 const int version)
const;
82 bool verifyEqualLogs(
const QList<QByteArray> &list,
86 const int version)
const;
87 bool verifyLogProof(
const QList<QByteArray> &list,
90 const int version)
const;
93 void setGuess(
const QString &guess);
95 void setModulus(
const gcry_mpi_t modulus)
97 gcry_mpi_release(m_modulus);
98 m_modulus = gcry_mpi_copy(modulus);
107 QString m_guessString;
117 gcry_mpi_t m_generator;
119 gcry_mpi_t m_modulus;
125 gcry_mpi_t generateRandomExponent(
bool *ok)
const;
127 size_t m_guessWhirlLength;
128 static const int TERMINAL_STATE = -1;
129 QList<QByteArray> step2(
const QList<QByteArray> &other,
bool *ok);
130 QList<QByteArray> step3(
const QList<QByteArray> &other,
bool *ok);
131 QList<QByteArray> step4(
const QList<QByteArray> &other,
135 void step5(
const QList<QByteArray> &other,
bool *ok,
bool *passed);
Definition: spot-on-smp.h:40